//
//  MSWeaponInfo.m
//  MagicSword
//
//  Created by Netease on 15/11/18.
//  Copyright © 2015年 Jonear. All rights reserved.
//

#import "MSWeaponInfo.h"

@implementation MSWeaponInfo

+ (NSDictionary *)getDictFromInfo:(MSWeaponInfo *)Info {
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setObject:Info.name forKey:@"name"];
    [dict setObject:@(Info.type) forKey:@"type"];
    [dict setObject:@(Info.model) forKey:@"model"];
    [dict setObject:@(Info.Attack) forKey:@"Attack"];
    [dict setObject:@(Info.Crit) forKey:@"Crit"];
    [dict setObject:@(Info.DoubleHit) forKey:@"DoubleHit"];
    [dict setObject:@(Info.Vampire) forKey:@"Vampire"];
    [dict setObject:Info.detailMsg forKey:@"detailMsg"];
    [dict setObject:@(Info.useCount) forKey:@"useCount"];
    [dict setObject:Info.imageName forKey:@"imageName"];
    return dict;
}

+ (MSWeaponInfo *)getInfoFromDict:(NSDictionary *)dict {
    MSWeaponInfo *info = [[MSWeaponInfo alloc] init];
    info.name = dict[@"name"];
    info.type = [dict[@"type"] integerValue];
    info.model = [dict[@"model"] integerValue];
    info.Attack = [dict[@"Attack"] integerValue];
    info.Crit = [dict[@"Crit"] integerValue];
    info.DoubleHit = [dict[@"DoubleHit"] integerValue];
    info.Vampire = [dict[@"Vampire"] integerValue];
    info.detailMsg = dict[@"detailMsg"];
    info.useCount = [dict[@"useCount"] integerValue];
    info.imageName = dict[@"imageName"];
    
    return info;
}

@end
